package com.charles.seckillcommon.core.exceptions;

/**
 * @author Charles-H
 * 
 * 全局异常
 */
public class GlobalException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    /**
     * 异常模块
     */
    private String module;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误信息
     */
    private String msg;

    /**
     * 错误参数
     */
    private Object[] args;

    public GlobalException(String module, Integer code, String msg, Object[] args) {
        this.module = module;
        this.code = code;
        this.msg = msg;
        this.args = args;
    }

    public GlobalException(String module, Integer code, Object[] args) {
        this(module, code, null, args);
    }

    public GlobalException(String module, String msg) {
        this(module, null, msg, null);
    }

    public GlobalException(Integer code, Object[] args) {
        this(null, code, null, args);
    }

    public GlobalException(String msg) {
        this(null, null, msg, null);
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }
}
